package com.allwees.bs.module.mms.wf;

import com.baomidou.mybatisplus.core.enums.IEnum;
import com.allwees.core.common.constant.EStatus;
import com.allwees.core.wf.Action;

/**
 * 零售商入驻流程相关动作
 *
 * @author yangylsky
 * @since 2019-12-03
 *
 */
public enum ERetailerApplyAction implements Action, IEnum<String> {
	//Retailer ACTION
	RETAILER_COMMIT(EStatus.WAIT_AUDIT),

	RETAILER_CANCEL,
	//end of Retailer ACTION

	//PLATFORM ACTION
	PLATFORM_FIRST_REJECTED(EStatus.MMS_FIRST_AUDIT_REJECTED),
	PLATFORM_FIRST_APPROVED(EStatus.MMS_FIRST_AUDIT_APPROVED),

	PLATFORM_FINAL_REJECTED(EStatus.MMS_FINAL_AUDIT_REJECTED),
	PLATFORM_FINAL_APPROVED(EStatus.NORMAL)
	//end of PLATFORM ACTION
	;

	private EStatus afterActionStatus;

	ERetailerApplyAction() {
		this(null);
	}

	ERetailerApplyAction(EStatus afterActionStatus) {
		this.afterActionStatus = afterActionStatus;
	}

	@Override
	public EStatus afterActionStatus() {
		return afterActionStatus;
	}

	@Override
	public String getValue() {
		return name();
	}

	public boolean isFinal(){
		return PLATFORM_FINAL_REJECTED.equals(this) || PLATFORM_FINAL_APPROVED.equals(this);
	}
}
